package com.mj.haier.rrskx.repository;

import java.util.Optional;

import javax.transaction.Transactional;

import java.util.*;

import com.mj.haier.rrskx.domain.AzOrderTitleFin;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;


/**
 * Spring Data  repository for the AzOrderTitleFin entity.
 */
@SuppressWarnings("unused")
@Repository
public interface AzOrderTitleFinRepository extends JpaRepository<AzOrderTitleFin, String> {

    Optional<AzOrderTitleFin> findByOrderCode(String orderCode);

    void deleteByOrderCode(String orderCode);

    @Transactional
    @Modifying(clearAutomatically = true)
    @Query("update AzOrderTitleFin f set f.isSettle = '2' where f.branchId = ?1 and f.orderCode = ?2")
    int updateAzOrderTitleFinSettle(String tradeCode, String orderCode);
}
